//
//  SSCheckoutCleanPageViewController.swift
//  拾舍清洁
//
//  Created by sky.wei on 2023/2/22.
//

import UIKit

class SSCheckoutCleanPageViewController: UIViewController {

    @IBOutlet weak var pagetitleView: PageTitleView!
    @IBOutlet weak var pagecontentView: PageContentView!
    //    var pagetitleView: PageTitleView!
    var vcs = [UIViewController]()

    override func viewDidLoad() {
        super.viewDidLoad()
        
      setupUI()
 
    }
    
    func setupUI() {
        
        title = "退房清洁"
        
        initChileViewControllers()
        
        pagetitleView.backgroundColor = UIColor.blue
        let styleTitle = PageStyle()
//        styleTitle.titleViewBackgroundColor = UIColor.clear
        styleTitle.titleFont = UIFont.systemFont(ofSize: 14, weight: .medium)
        styleTitle.titleColor = UIColor.black
        styleTitle.titleSelectedColor = UIColor.themeColor
        styleTitle.coverViewRadius = 0
        styleTitle.coverMargin = 5
        styleTitle.isShowCoverView = false
        styleTitle.isShowBottomLine = true
        styleTitle.bottomLineColor = UIColor.themeColor
        styleTitle.bottomLineHeight = 2
        styleTitle.bottomLineWidth = 0
        let titles = ["退房清洁", "退房清洁"]
        pagetitleView.initData(style: styleTitle, titles: titles,subTitles: ["（包含蒸汽地毯）","（不包含蒸汽地毯）"], currentIndex: 0)
        pagecontentView.initData(style: styleTitle, childViewControllers: vcs, currentIndex: 0)
        
        pagetitleView.delegate = pagecontentView
        pagecontentView.delegate = pagetitleView

    }
    
    func initChileViewControllers(){
        let vc1 = SSCheckoutCleanViewController()
        vc1.type = "2"
        vcs.append(vc1)
//        vc1.view.backgroundColor = UIColor.red
        self.addChild(vc1)
        
        let vc2 = SSCheckoutCleanViewController()
//        vc2.view.backgroundColor = UIColor.blue
        vc2.type = "1"
        vcs.append(vc2)
        self.addChild(vc2)
    }

}


